package com.zhentao.model.pojo.car.enums;

public enum AutomobileDisplacement {

    MINICARS(1, "1L以下"),
    SUBCOMPACTCAR(2,"1.0~1.6L"),
    INTERMEDIATESEDAN(3,"1.6~2.5L"),
    MID_TO_HIGH_END_SEDANS(4,"2.5~4L"),
    PREMIUM_SEDANS(5,"4.0L以上");

    int code;
    String text;

    AutomobileDisplacement(int code, String text){
        this.code = code;
        this.text = text;
    }

    public int getCode() {
        return code;
    }

    public String getADText() {
        return text;
    }

    public static String getAutomobileDisplacement(int code){
       switch (code){
           case 1:
               return MINICARS.getADText();
           case 2:
               return SUBCOMPACTCAR.getADText();
           case 3:
               return INTERMEDIATESEDAN.getADText();
           case 4:
               return MID_TO_HIGH_END_SEDANS.getADText();
           case 5:
               return PREMIUM_SEDANS.getADText();
       }
        return null;
    }
}
